#pragma once
#include "sqlite3.h"
#include <string>
#include <unordered_map>
#include <vector>
#include "FinanceEntry.h"

typedef std::unordered_map<std::string, std::string> map_str2str;
typedef std::vector<CFinanceEntry> read_ret, items_to_write;

class CSqliteDB {
public:
    CSqliteDB();
    CSqliteDB(std::string path);
    ~CSqliteDB();
    sqlite3* GetDB() const;
    bool ReadFromDB(read_ret& ret) const;
    bool ReadById(int id, read_ret& ret) const;
    bool ReadRecentItems(int num_of_items, read_ret& ret) const;
    
    bool WriteToDB(CFinanceEntry entry) const;

private:
    sqlite3* m_db;

};